/**
 * 主题样式模板
 */
@mixin page-ui($theme,
 		$containerBorderColor, $formBgColor, $propNameBgColor, $btnDefaultIconColor,
 		$controlBorderColor, $controlFocusBorderColor, $controlRequiredBorderColor,
		$listBtnColor, $listBtnBgColor, $listBtnBorderColor, $listDefaultLinkColor,
		$dataHoverBgColor, $dataHoverColor, $processingDlgColor) {

	/** 通用的样式　*/
	body.#{$theme} {
		input:focus, select:focus, textarea:focus {
			border-color: $controlFocusBorderColor;
		}

		// 组件：typeahead (autocomplete)、combobox 等
		ul.typeahead.dropdown-menu > .active {
			> a, > a:hover, > a:focus {
				background-color: $dataHoverBgColor;
				color: $dataHoverColor;
			}
		}

		// 组件：tabs
		:not(.nav-tabs-custom) > .nav-tabs {
			border-bottom-color: $containerBorderColor;
			> li.active a {
				border-color: $containerBorderColor;
				border-bottom-color: adjust-color($containerBorderColor, $lightness: +13%); // transparent
			}
		}

		// 组件：选择树（treeField、osmField）
		.o-tree-selector {
			.o-tree-selector-maintable {
				// 防止已选列表单元格在 IE10 下没有下边框
				border-top-color: $containerBorderColor !important;
				border-left-color: $containerBorderColor !important;
				th, td {
					border-right-color: $containerBorderColor !important;
					border-bottom-color: $containerBorderColor !important;
				}

				.o-tree-selector-containertd .containerDiv {
					.treeDiv {
						border-right-color: $containerBorderColor;
					}
					.selectedDiv {
						border-left-color: $containerBorderColor;
					}
				}
			}
		}
	}

	/* 等待提示窗口 */
	body.#{$theme} {
		#o-processing-dlg .modal-dialog .modal-content .modal-body .overlay i {
			color: $processingDlgColor;
		}
	}

	/** 列表视图 */
	body.#{$theme}.o-list,
	body.#{$theme}.o-form div.o-list {

		/** 操作按钮颜色 @see .btn-danger */
		.dataTables_paginate .btn, // 组件：dataTables
		.toolbar .btn,
		.pagination .btn,
		.buttons .btn,
		.list button.btn {
			color: $listBtnColor;
			border-color: $listBtnBorderColor;
			background-color: $listBtnBgColor;
		}

		/** 数据列表 */
		.list table {
			// 给第一个 td 或者 td.o-default-link 里的链接着色
			tbody:not(.o-default-link) tr td:first-child a,
			tbody.o-default-link tr td.o-default-link a {
				color: $listDefaultLinkColor;
			}
		}

		/** 翻页栏、操作栏 */
		.pagination, .buttons {
			/** 翻页器 */
			.o-pagination-pager {
				.step, .prevLink, .nextLink {
					color: $listBtnBgColor;
					border-color: $controlBorderColor;
				}
				.currentStep {
					color: $listBtnColor;
					border-color: $listBtnBorderColor;
					background-color: $listBtnBgColor;
				}
			}
			@at-root body.#{$theme} .pagination {
				// 覆盖 bs & AdminLTE
				> li > a {
					background-color: transparent;
				}
				> .active {
					> a, > span, > a:hover, > span:hover, > a:focus, > span:focus {
						color: $listBtnColor;
						border-color: $listBtnBorderColor;
						background-color: $listBtnBgColor;
					}
				}
				> :not(.active) {
					> a:not(.btn), > span, > a:hover:not(.btn), > span:hover, > a:focus:not(.btn), > span:focus {
						color: $listBtnBgColor;
					}
				}
				.disabled {
					> a, > span, > a:hover, > span:hover, > a:focus, > span:focus {
						color: lightgray; // #777;
					}
				}
			}

			/** 输入页号跳转 */
			@mixin o-pagination-go() {
				input.goLink {
					color: $listBtnBgColor;
					border-color: $controlBorderColor;
				}
				input.goLink:focus {
					border-color: $controlFocusBorderColor;
				}
			}
			.o-pagination-go {
				@include o-pagination-go()
			}
			@at-root body.#{$theme} div.dataTables_paginate .o-pagination-go {
				// 组件：dataTables
				@include o-pagination-go()
			}
		}
	}

	/** 列表视图：非嵌入的 */
	body.#{$theme}.o-list:not(.o-list-embeded),
	body.#{$theme}:not(.o-form) div.o-list {
		.list table:not(.dialog) {
			thead tr > :hover,
			thead tr > :hover a,
			tfoot tr > :hover,
			tfoot tr > :hover a,
			tbody tr:hover,
			tbody tr:hover td,
			tbody tr:hover td a {
				background-color: $dataHoverBgColor;
				color: $dataHoverColor;
			}
		}
	}

	/** 表单视图 */
	body.#{$theme}.o-form {
		#layoutBody {
			> .body {
				border-color: $containerBorderColor;
				background-color: $formBgColor;

				/* 标题 */
				> h1 {
					background: $containerBorderColor;
				}

				/* 操作栏按钮 */
				.buttons {
					background: $containerBorderColor;
				}
			}
		}
	}

	/** 表格等 */
	body.#{$theme} {
		/** 表格：表单属性 */
		.dialog table,
		table.dialog {
			tr.prop {
				> td, > th {
					border-color: $containerBorderColor;
				}
				> td.name, > th.name,
				> td.nameX, > th.nameX,
				> td.title.bgcolor {
					background-color: $propNameBgColor;
				}
			}
		}

		/** 表单控件 */
		.input-group .input-group-addon {
			color: $btnDefaultIconColor;
		}

		/** 表格内部的子表格，如动态表 */
		.dialog {
			.o-inner-table table,
			table.o-inner-table {
				th, td {
					border-color: $containerBorderColor;
				}
				th {
					background-color: $propNameBgColor;
				}
				// 输入框
				td input, td select,
				.input-group .input-group-addon.dropdown-toggle {
					border-bottom-color: $controlBorderColor;
				}
				input[required], select[required],
				.input-group .input-group-addon.dropdown-toggle.required {
					border-bottom-color: $controlRequiredBorderColor;
				}
			}
		}

	}

	/** 默认按钮的图标颜色 */
	body.#{$theme} .btn.btn-default i {
		color: $btnDefaultIconColor;
	}
}

/* 红色主题 */

$containerBorderColor:       #f7b7ad;
$formBgColor:                #ffffff;
$propNameBgColor:            #faeae6;
$btnDefaultIconColor:        #f39900;

$controlBorderColor:         #cccccc;
$controlFocusBorderColor:    #ed988c;
$controlRequiredBorderColor: #f7b7ad;

$listBtnColor:               #ffffff;
$listBtnBgColor:             #dd4b39;
$listBtnBorderColor:         #d73925;
$listDefaultLinkColor:       #d55746;

$dataHoverBgColor:           #ed988c;
$dataHoverColor:             #ffffff;
$processingDlgColor:         #d55746;

@include page-ui(skin-red-light,
		$containerBorderColor, $formBgColor, $propNameBgColor, $btnDefaultIconColor,
		$controlBorderColor, $controlFocusBorderColor, $controlRequiredBorderColor,
		$listBtnColor, $listBtnBgColor, $listBtnBorderColor, $listDefaultLinkColor,
		$dataHoverBgColor, $dataHoverColor, $processingDlgColor);
@include page-ui(skin-red,
		$containerBorderColor, $formBgColor, $propNameBgColor, $btnDefaultIconColor,
		$controlBorderColor, $controlFocusBorderColor, $controlRequiredBorderColor,
		$listBtnColor, $listBtnBgColor, $listBtnBorderColor, $listDefaultLinkColor,
		$dataHoverBgColor, $dataHoverColor, $processingDlgColor);

/* 蓝色主题 */

$containerBorderColor:       #81C0E9;
$formBgColor:                #ffffff;
$propNameBgColor:            #DAEDFB;
$btnDefaultIconColor:        #81C0E9;

$controlBorderColor:         #88C4E9;
$controlFocusBorderColor:    #81C0E9;
$controlRequiredBorderColor: #81C0E9;

$listBtnColor:               #ffffff;
$listBtnBgColor:             #3C8DBC;
$listBtnBorderColor:         #3C8DBC;
$listDefaultLinkColor:       #d55746;

$dataHoverBgColor:           #81C0E9;
$dataHoverColor:             #ffffff;
$processingDlgColor:         #3C8DBC;

@include page-ui(skin-blue-light,
		$containerBorderColor, $formBgColor, $propNameBgColor, $btnDefaultIconColor,
		$controlBorderColor, $controlFocusBorderColor, $controlRequiredBorderColor,
		$listBtnColor, $listBtnBgColor, $listBtnBorderColor, $listDefaultLinkColor,
		$dataHoverBgColor, $dataHoverColor, $processingDlgColor);
@include page-ui(skin-blue,
		$containerBorderColor, $formBgColor, $propNameBgColor, $btnDefaultIconColor,
		$controlBorderColor, $controlFocusBorderColor, $controlRequiredBorderColor,
		$listBtnColor, $listBtnBgColor, $listBtnBorderColor, $listDefaultLinkColor,
		$dataHoverBgColor, $dataHoverColor, $processingDlgColor);

/* 紫色主题 */

$containerBorderColor:       #9690F0;
$formBgColor:                #ffffff;
$propNameBgColor:            #DAD7F6;
$btnDefaultIconColor:        #9690F0;

$controlBorderColor:         #9690F0;
$controlFocusBorderColor:    #9690F0;
$controlRequiredBorderColor: #9690F0;

$listBtnColor:               #ffffff;
$listBtnBgColor:             #6662b9;
$listBtnBorderColor:         #6058A2;
$listDefaultLinkColor:       #d55746;

$dataHoverBgColor:           #9690F0;
$dataHoverColor:             #ffffff;
$processingDlgColor:         #605CA8;

@include page-ui(skin-purple-light,
		$containerBorderColor, $formBgColor, $propNameBgColor, $btnDefaultIconColor,
		$controlBorderColor, $controlFocusBorderColor, $controlRequiredBorderColor,
		$listBtnColor, $listBtnBgColor, $listBtnBorderColor, $listDefaultLinkColor,
		$dataHoverBgColor, $dataHoverColor, $processingDlgColor);
@include page-ui(skin-purple,
		$containerBorderColor, $formBgColor, $propNameBgColor, $btnDefaultIconColor,
		$controlBorderColor, $controlFocusBorderColor, $controlRequiredBorderColor,
		$listBtnColor, $listBtnBgColor, $listBtnBorderColor, $listDefaultLinkColor,
		$dataHoverBgColor, $dataHoverColor, $processingDlgColor);

/* 绿色主题 */

$containerBorderColor:       #67CA93;
$formBgColor:                #ffffff;
$propNameBgColor:            #C5E4D4;
$btnDefaultIconColor:        #67CA93;

$controlBorderColor:         #67CA93;
$controlFocusBorderColor:    #67CA93;
$controlRequiredBorderColor: #67CA93;

$listBtnColor:               #ffffff;
$listBtnBgColor:             #00A65A;
$listBtnBorderColor:         #00A65A;
$listDefaultLinkColor:       #d55746;

$dataHoverBgColor:           #67CA93;
$dataHoverColor:             #ffffff;
$processingDlgColor:         #00A65A;

@include page-ui(skin-green-light,
		$containerBorderColor, $formBgColor, $propNameBgColor, $btnDefaultIconColor,
		$controlBorderColor, $controlFocusBorderColor, $controlRequiredBorderColor,
		$listBtnColor, $listBtnBgColor, $listBtnBorderColor, $listDefaultLinkColor,
		$dataHoverBgColor, $dataHoverColor, $processingDlgColor);
@include page-ui(skin-green,
		$containerBorderColor, $formBgColor, $propNameBgColor, $btnDefaultIconColor,
		$controlBorderColor, $controlFocusBorderColor, $controlRequiredBorderColor,
		$listBtnColor, $listBtnBgColor, $listBtnBorderColor, $listDefaultLinkColor,
		$dataHoverBgColor, $dataHoverColor, $processingDlgColor);

/* 黄色主题 */

$containerBorderColor:       #F3BF6C;
$formBgColor:                #ffffff;
$propNameBgColor:            #F9E2C0;
$btnDefaultIconColor:        #F3BF6C;

$controlBorderColor:         #F0B95F;
$controlFocusBorderColor:    #F3BF6C;
$controlRequiredBorderColor: #F3BF6C;

$listBtnColor:               #ffffff;
$listBtnBgColor:             #F69A11;
$listBtnBorderColor:         #F39C11;
$listDefaultLinkColor:       #d55746;

$dataHoverBgColor:           #F3BF6C;
$dataHoverColor:             #ffffff;
$processingDlgColor:         #FC9311;

@include page-ui(skin-yellow-light,
		$containerBorderColor, $formBgColor, $propNameBgColor, $btnDefaultIconColor,
		$controlBorderColor, $controlFocusBorderColor, $controlRequiredBorderColor,
		$listBtnColor, $listBtnBgColor, $listBtnBorderColor, $listDefaultLinkColor,
		$dataHoverBgColor, $dataHoverColor, $processingDlgColor);
@include page-ui(skin-yellow,
		$containerBorderColor, $formBgColor, $propNameBgColor, $btnDefaultIconColor,
		$controlBorderColor, $controlFocusBorderColor, $controlRequiredBorderColor,
		$listBtnColor, $listBtnBgColor, $listBtnBorderColor, $listDefaultLinkColor,
		$dataHoverBgColor, $dataHoverColor, $processingDlgColor);

/* 黑色主题 */

$containerBorderColor:       #B5B5B5;
$formBgColor:                #ffffff;
$propNameBgColor:            #EBEBEB;
$btnDefaultIconColor:        #B5B5B5;

$controlBorderColor:         #B5B5B5;
$controlFocusBorderColor:    #B5B5B5;
$controlRequiredBorderColor: #B5B5B5;

$listBtnColor:               #ffffff;
$listBtnBgColor:             #404040;
$listBtnBorderColor:         #434343;
$listDefaultLinkColor:       #d55746;

$dataHoverBgColor:           #B5B5B5;
$dataHoverColor:             #ffffff;
$processingDlgColor:         #0D0D0D;

@include page-ui(skin-black-light,
		$containerBorderColor, $formBgColor, $propNameBgColor, $btnDefaultIconColor,
		$controlBorderColor, $controlFocusBorderColor, $controlRequiredBorderColor,
		$listBtnColor, $listBtnBgColor, $listBtnBorderColor, $listDefaultLinkColor,
		$dataHoverBgColor, $dataHoverColor, $processingDlgColor);
@include page-ui(skin-black,
		$containerBorderColor, $formBgColor, $propNameBgColor, $btnDefaultIconColor,
		$controlBorderColor, $controlFocusBorderColor, $controlRequiredBorderColor,
		$listBtnColor, $listBtnBgColor, $listBtnBorderColor, $listDefaultLinkColor,
		$dataHoverBgColor, $dataHoverColor, $processingDlgColor);

